<?php
session_start();
include '../../operations/connection.php';

$a= (string)(microtime(true)*1000);
$b=split('\.',$a);
$partnerID= "UC".$b[0];

$parnername = $_REQUEST['parnername'];
$password = strtoupper(md5($_REQUEST['password']));
$repassword = $_REQUEST['repassword'];
$databasename = $_REQUEST['databasename'];
$email = $_REQUEST['email'];
$phone = $_REQUEST['phone'];
$website = $_REQUEST['website'];

$idpartnercomp = $_REQUEST['idpartnercomp']; 

if(isset($_REQUEST['register'])){
	$insertpartner = "insert into ac_eli_manager(PartnerID,PartnerName,Email,Phone,Website,UserName,Password,DatabaseName,Role,Status)
		VALUES('$partnerID','$parnername','$email','$phone','$website','admin','$password','$databasename',2,2);";
	mysql_query($insertpartner);
}else if (isset($_REQUEST['update'])){
	$updatepartner = "UPDATE ac_eli_manager set PartnerName='$parnername',Email='$email',Phone='$phone',Website='$website',
		Password='$password',DatabaseName='$databasename' where  PartnerID='$idpartnercomp'";
	mysql_query($updatepartner);
}
mysql_close($connection);


if(isset($_REQUEST['register'])){
	$_SESSION['insertpartner'] ="";
	header("Location: ../../partnermanage.php");
}
if (isset($_REQUEST['update'])){
	$_SESSION['updatepartner'] ="";
	header("Location: ../../partnermanage.php");
}

ob_flush();


?>